#ifndef _YFS_LIB_

#define SEEK_SET 0 /* start of stream (see fseek) */
#define SEEK_CUR 1 /* current position in stream (see fseek) */
#define SEEK_END 2 /* end of stream (see fseek) */

//import
//#include <gtDev.h>

//extern
int  fs_io_Init(int index);
int  fs_io_format(void (*pCallback)());
int  fs_io_open(const char *name, const char *mode);
int  fs_io_write(const void *buffer,int size,int cnt,int fd);
int  fs_io_read(void *buffer,int size,int cnt,int fd);
int  fs_io_close(int fd);
int  fs_io_seek(int fd,long int offset,int whence);
int  fs_io_mkdir (const char *path);
int  fs_io_rm (const char *path);
int  fs_io_del(const char *path);
int  fs_io_rename (const char *oldpath,const char *newpath);
int  fs_io_list (const char *path);
long fs_io_len (int fd);
long fs_io_size (int fd);
long fs_io_sync (int fd);
int  fs_io_unlink (const char *name);
unsigned int fs_ffind (unsigned char code, unsigned char *buf, unsigned char *mask, unsigned int buflen);
int yaffs_io_close(int fp);


#ifndef FHANDLE
	#define FHANDLE int
	#define FOPEN 	yaffs_io_open
	#define FCLOSE 	yaffs_io_close//fs_io_close
	#define FWRITE	fs_io_write
	#define FREAD	fs_io_read
	#define FSEEK	yaffs_io_seek
	#define FTELL	fs_io_len
	#define FSIZE	fs_io_size 
	#define FRM		fs_io_unlink
	#define FRMDIR	fs_io_rmdir
	#define FMKDIR	fs_io_mkdir
	#define FREN	fs_io_rename
	#define FSYNC	fs_io_sync
	#define FDEL	fs_io_del
	
	#define FINIT	fs_io_Init
	#define FFORMAT	fs_io_format
	#define FLIST	fs_io_list
	#define FFIND fs_ffind
#endif

#define _YFS_LIB_
#endif
